﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

namespace Utility.BehaviourTree
{
	[HideFromCreateMenu]
	public class ActNode : LeafNode
	{
		Action<DataBoard> action;

		public ActNode (Action<DataBoard> action)
		{
			Debug.Assert (action != null, "action cannot be null");
			this.action = action;
		}

		protected override Status OnUpdate ()
		{
			action (DataBoard);
			return Status.Success;
		}

	}

}